package cmcciot.onenet.nbapi.sdk.api.offline;

import cmcciot.onenet.nbapi.sdk.api.online.BasicOpe;
import cmcciot.onenet.nbapi.sdk.entity.CommonEntity;
import cmcciot.onenet.nbapi.sdk.utils.HttpSendCenter;
import okhttp3.Callback;
import org.json.JSONObject;

/**
 * @author LHL
 * @date: 2018/8/1
 */
public class ReadOpeCache extends BasicOpe {
    public ReadOpeCache(String apiKey) {
        super(apiKey);
    }

    @Override
    public JSONObject operation(CommonEntity commonEntity, JSONObject body) {
        return HttpSendCenter.get(apiKey, commonEntity.toUrl());
    }

    @Override
    public void operation(CommonEntity commonEntity, JSONObject body, Callback callback) {
        HttpSendCenter.getAsync(apiKey, commonEntity.toUrl(), callback);
    }
}
